import request from '@/utils/request.js';

export const addTodoService = (addDate) => {
  return request.post('/todo', addDate);
};

// 分页查询
export const todoListService = (params) => {
  return request.get('/todo', { params });
};

// 完成
export const completeTodoService = (id) => {
  return request.put(`/todo/${id}/complete`);
};

// 修改
export const updateTodoService = (item) => {
  return request.put('/todo', item);
};

// 删除
export const deleteTodoService = (id) => {
  return request.delete(`/todo/${id}`);
};
